-- 配置 render-markdown.nvim
return {
  enabled = true,
  "MeanderingProgrammer/render-markdown.nvim",
  -- dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-mini/mini.nvim" }, -- if you use the mini.nvim suite
  -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins
  dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
  ---@module 'render-markdown'
  ---@type render.md.UserConfig
  opts = {
    file_types = { "markdown", "vimwiki" },
    -- 建议也检查以下全局设置
    win_options = {
      concealcursor = {
        rendered = "nvc",
      },
      conceallevel = {
        rendered = 2, -- 设置为2将显示替换字符而非完全隐藏:cite[1]
      },
    },

    html = {
      enabled = true,
      -- render_attributes = true, -- 尝试添加这个选项
      comment = {
        conceal = true,
        text = nil, -- 设置为nil可能使用默认隐藏
        highlight = "RenderMarkdownHtmlComment",
      },
     -- tag = {
     --    "<%s>%s</%s>", -- 尝试简单的字符串表示 TODO
     --  },
    },

    sign = { enabled = false },

    completions = {
      lsp = { enabled = true },
    },

    anti_conceal = { -- 反隐藏 模式 (n-normal, v-visual, i-insert, c-command)
      -- disabled_mode = {"ni"},
      disabled_mode = nil,
      ignore = {
        bullet = true,
        head_border = true,
        head_background = true,
      },
    },
    heading = {
      position = "right",
      above = "▄",
      border = true,
    },
    pipe_table = {
      preset = "round",
      style = "full",
      head_border = nil,
    },

    indent = {
      -- Mimic org-indent-mode behavior by indenting everything under a heading based on the
      -- level of the heading. Indenting starts from level 2 headings onward by default.

      -- Turn on / off org-indent-mode.
      enabled = true,
      -- Additional modes to render indents.
      render_modes = false,
      -- Amount of additional padding added for each heading level.
      per_level = 1,
      -- Heading levels <= this value will not be indented.
      -- Use 0 to begin indenting from the very first level.
      skip_level = 1,
      -- Do not indent heading titles, only the body.
      skip_heading = false,
      -- Prefix added when indenting, one per level.
      icon = "▎",
      -- Priority to assign to extmarks.
      priority = 0,
      -- Applied to icon.
      highlight = "RenderMarkdownIndent",
    },
    callout = {
      note = { raw = "[!NOTE]", rendered = "󰋽 Note", highlight = "RenderMarkdownInfo" },
      tip = { raw = "[!TIP]", rendered = "󰌶 Tip", highlight = "RenderMarkdownSuccess" },
      important = { raw = "[!IMPORTANT]", rendered = "󰅾 Important", highlight = "RenderMarkdownHint" },
      warning = { raw = "[!WARNING]", rendered = "󰀪 Warning", highlight = "RenderMarkdownWarn" },
      caution = { raw = "[!CAUTION]", rendered = "󰳦 Caution", highlight = "RenderMarkdownError" },
      -- Obsidian: https://help.a.md/Editing+and+formatting/Callouts
      abstract = { raw = "[!ABSTRACT]", rendered = "󰨸 Abstract", highlight = "RenderMarkdownInfo" },
      todo = { raw = "[!TODO]", rendered = "󰗡 Todo", highlight = "RenderMarkdownInfo" },
      success = { raw = "[!SUCCESS]", rendered = "󰄬 Success", highlight = "RenderMarkdownSuccess" },
      question = { raw = "[!QUESTION]", rendered = "󰘥 Question", highlight = "RenderMarkdownWarn" },
      failure = { raw = "[!FAILURE]", rendered = "󰅖 Failure", highlight = "RenderMarkdownError" },
      danger = { raw = "[!DANGER]", rendered = "󱐌 Danger", highlight = "RenderMarkdownError" },
      bug = { raw = "[!BUG]", rendered = "󰨰 Bug", highlight = "RenderMarkdownError" },
      example = { raw = "[!EXAMPLE]", rendered = "󰉹 Example", highlight = "RenderMarkdownHint" },
      quote = { raw = "[!QUOTE]", rendered = "󱆨 Quote", highlight = "RenderMarkdownQuote" },
    },
  },
}
